<!--
 * @Author: yxiawen
 * @Date: 2022-01-14 22:23:04
 * @LastEditTime: 2022-01-24 14:26:15
 * @LastEditors: yxiawen
 * @Description:
 * @FilePath: /vite-project/src/views/home/home.vue
-->
<template>
  <div class="">
    home
    <a-button type="primary"
              @click="testClick()">Primary Button</a-button>
  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';
import { onMounted, getCurrentInstance } from "vue";

export default {
  //import引入的组件需要注入到对象中才能使用
  name: "home",
  components: {},
  setup() {
    const {
      appContext: {
        config: { globalProperties },
      },
    } = getCurrentInstance();
    onMounted(() => {});
    const testClick = () => {
      globalProperties.$apis.testApi.test({}).then((res) => {
        console.log(res);
      });
    };
    return {
      testClick,
    };
  },
};
</script>
<style lang="less" scoped>
//@import url(); 引入公共css类
</style>
